﻿<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>ManageSystem后台管理系统</title>
    <!-- bootstrap 3.0.2 -->
    <link href="/resource/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="/resource/css/style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/resource/js/jQueryMessage/css/message.skin.css" />
	<style>
		option{
			width: 200px;
		}
		select{
			width: 200px;
		}
	</style>
</head>

<body>
	<div class="row">
	    <div class="col-md-12">
	    	<h1 class="panel-heading">新增授课信息</h1>
	        <!--breadcrumbs start -->
	        <ul class="breadcrumb">
				<li><a href="/index/toIndex"><i class="fa fa-home"></i> 首页</a></li>
				<li class="active">新增授课信息</li>
			</ul>
	        <!--breadcrumbs end -->
	    </div>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<section class="panel">
				<div class="panel-body">
					<form class="col s12" id="form1" enctype="multipart/form-data" th:action="@{/stu/instruct/add}" onsubmit="return validateForm();" method="post">
							<div class="form-group form-control-medium">
								<label for="teacherId">教师ID：</label>
								<select class="form-group" id="teacherId" name="teacherId" >
									<span th:each="item,stat : ${teacherIds}">
									<option th:text="${item}" th:value="${item}"></option>
									</span>
								</select>
							</div>
							<div class="form-group form-control-medium">
								<label for="classId">班级ID：</label>
								<select class="form-group" id="classId" name="classId" >
									<span th:each="item,stat : ${classIds}">
									<option th:text="${item}" th:value="${item}"></option>
									</span>
								</select>
							</div>
							<div class="form-group form-control-medium">
								<label for="lessonId">课程ID：</label>
								<select class="form-group" id="lessonId" name="lessonId" >
									<span th:each="item,stat : ${lessonIds}">
									<option th:text="${item}" th:value="${item}"></option>
									</span>
								</select>
							</div>

							<input id="createdBy" name="createdBy" type="hidden" class="form-control" />

							<div class="form-btn-group-left">
			            		<button type="submit" class="btn btn-info">保存</button>
								<button type="button" class="btn btn-info" id="back"><a href="/stu/instruct/list">返回</a></button>
			            	</div>
					</form>
				</div>
			</section>
		</div>
	</div>
	<script src="/resource/js/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/resource/js/jQueryMessage/js/jquery.plugin.message.js"></script>
    
    <script type="text/javascript" th:inline="javascript">
	   	/* 保存方法 */
	    function validateForm(){
	    	return true;
	    }

		//获取当前登录的用户
		var userStr = sessionStorage.getItem("douglas");
		if(userStr == null || userStr == "" || userStr == "undefined"){
			window.location.href = "/admin/user/toLogin";
		}else{
			var user = JSON.parse(userStr);
			$("#createdBy").val(user.realname);
		}
    </script>
</body>
</html>
